#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int n,i,j;
int sc(int n)
{
    if(n<2) return false;
    else
    {
        for (int i = 2; i <= n/i; i ++ )
        {
            if(n%i==0)
                return false;
            
            
        }
        return true;
    }
    
}
int main()
{
    int m;
    cin>>m;
    while (m -- )
    {
        int a;
        cin>>a;
        if(sc(a)) printf("Yes\n");
        else printf("No\n");
    }
}
